<?php

namespace app\mobile\controller;

use app\api\model\Article as ArticleModel;
use think\Controller;

use app\store\model\store\Shop as ShopModel;
use think\Db;

class Xuevideo extends Controller
{
    public function index(){
        $category_id = 8;
        $model = new ArticleModel;
        $list = $model->getList($category_id)->toArray();
        $dataArr = $list['data'];
        //ddd($dataArr);
        $this->assign('dataArr', json_encode($dataArr,true));
        return $this->fetch('xuevideo/index');
    }

    public function des(){
        $paramArr = $this->request->param();
        $detail = ArticleModel::detail($paramArr['aid']);
        $this->assign('des', $detail);
        //ddd($detail);
        return $this->fetch('xuevideo/des');
    }

    public function ajaxDes(){
        $paramArr = $this->request->param();
        $detail = ArticleModel::detail($paramArr['aid']);
        $back['state'] = 'addOk';
        $back['des'] = $detail;
        return ajaxSuccessObj($back, '添加修改成功');
    }
}